
********************************************************************************
************************************Appendix A**********************************
******************************************************************************** 


use "/Users/zerenli1992/Dropbox/political_risk/replication_files/pc_df_2022test.dta" ,clear

run "/Users/zerenli1992/Dropbox/political_risk/replication_files/data_pre_process"

*************************************
* Table A1 Summary Statistics
*************************************
*See R Code

*************************************
* Table A2 Summary Statistics
*************************************
*See R Code

*************************************
* Table A3 Alternative clustering se 
*************************************

global full_spc    nocons  dec(3) addstat(Adjusted R-squared, e(r2_a))   lab 

* Province Clustered
reghdfe roa pc_dummy ,  absorb(year symbol)  cluster(prov_code)
eststo m1x

reghdfe roa pc_dummy  ${covariates}  ,  absorb(year symbol)  cluster(prov_code)
eststo m10

reghdfe roa pc_dummy  i.ind_code_res#c.year ${covariates} ,  absorb(year symbol)  cluster(prov_code)
eststo m11

reghdfe roa pc_dummy  i.prov_code#c.year ${covariates} ,  absorb(year symbol)  cluster(prov_code)
eststo m12

reghdfe roa pc_dummy  i.ind_code_res#c.year  i.prov_code#c.year ${covariates} ,  absorb(year symbol )  cluster(prov_code)
eststo m13

* Sector Clustered
reghdfe roa pc_dummy ,  absorb(year symbol)  cluster(ind_code_res)
eststo m2x

reghdfe roa pc_dummy  ${covariates}  ,  absorb(year symbol)  cluster(ind_code_res)
eststo m20

reghdfe roa pc_dummy  i.ind_code_res#c.year ${covariates} ,  absorb(year symbol)  cluster(ind_code_res)
eststo m21

reghdfe roa pc_dummy  i.prov_code#c.year ${covariates} ,  absorb(year symbol)  cluster(ind_code_res)
eststo m22

reghdfe roa pc_dummy  i.ind_code_res#c.year  i.prov_code#c.year ${covariates} ,  absorb(year symbol )  cluster(ind_code_res)
eststo m23

outreg2 [m1x m10 m11 m12 m13] using "$test/se_robust.tex", replace  $full_spc
outreg2 [m2x m20 m21 m22 m23] using "$test/se_robust1.tex", replace  $full_spc


********************************
* Table A5 Flexible Esimtation
********************************
global full_spc    nocons  dec(3) addstat(Adjusted R-squared, e(r2_a))   lab 

lab var pc_f4plus_dummy "Hire in 4+ yrs"
lab var pc_f3_dummy  "Hire in 3yrs"
lab var pc_f2_dummy  "Hire in 2yrs"
lab var pc_f1_dummy  "Hire in 1yrs"
lab var pc_dummy_1 "Hire for 1 yr"         
lab var pc_dummy_2 "Hire for 2+ yrs "
lab var pc_l1_dummy "Used to hire 1 yr ago"
lab var pc_l2_dummy "Used to hire 2 yrs ago"
lab var pc_l3_dummy "Used to hire 3+ yrs ago"

global flex  pc_f4plus_dummy pc_f3_dummy pc_f2_dummy pc_f1_dummy ///
 pc_dummy_1 pc_dummy_2  pc_l1_dummy pc_l2_dummy   pc_l3plus_dummy 
*
reghdfe roa $flex ,  absorb(year symbol)  cluster(symbol)
qui outreg2 using "$test/baseline.tex", replace $full_spc keep ( $flex )  ///
addtext(Firm and Year FE, Y , Firm Controls, N , Sector Specific Time Trend, N, Province Specific Time Trend, N) 

reghdfe roa $flex  ${covariates},  absorb(year symbol)  cluster(symbol)
qui outreg2 using "$test/baseline.tex", append $full_spc  keep ($flex) addtext(Firm and Year FE, Y,Firm Controls, Y , Sector Specific Time Trend, N, Province Specific Time Trend, N) 

reghdfe roa $flex  i.ind_code_res#c.year ${covariates} ,  absorb(year symbol)  cluster(symbol)
qui outreg2 using "$test/baseline.tex", append $full_spc keep ($flex) addtext(Firm and Year FE, Y,Firm Controls, Y , Sector Specific Time Trend, Y,Province Specific Time Trend, N) 

reghdfe roa $flex  i.prov_code#c.year ${covariates} ,  absorb(year symbol)  cluster(symbol)
 outreg2 using "$test/baseline.tex", append $full_spc keep ($flex) addtext(Firm and Year FE, Y,Firm Controls, Y, Sector Specific Time Trend, N,Province Specific Time Trend,Y)  

reghdfe roa $flex  i.ind_code_res#c.year  i.prov_code#c.year ${covariates} ,  absorb(year symbol)  cluster(symbol)
 outreg2 using "$test/baseline.tex", append $full_spc keep ($flex) addtext(Firm and Year FE, Y,Firm Controls, Y , Sector Specific Time Trend, Y, Province Specific Time Trend,Y)   

 
*******************************************
* Table A6 ADL and ECM Specifications
*******************************************
*ADL
global full_spc    nocons  dec(3) addstat(Adjusted R-squared, e(r2_a))   lab ///noaster

xtreg roa l.roa pc_dummy l.pc_dummy ${covariates} ,  cluster(symbol)

qui outreg2 using "$test/baseline.tex", replace  drop (${covariates}) addtext(Firm and Year FE, Y , Firm Controls, Y)  lab ctitle(ADL)

*ECM
xtreg d.roa l.roa l.pc_dummy d.pc_dummy  ${covariates} ,  cluster(symbol)

outreg2 using "$test/baseline.tex", append  drop (${covariates}) addtext(Firm and Year FE, Y , Firm Controls, Y)  lab  ctitle(ECM)


******************************************************
* Table A7 Alternative Measures of Firm Performance
******************************************************

reghdfe profm pc_dummy  i.ind_code_res#c.year  i.prov_code#c.year ${covariates} ,  absorb(year symbol)  cluster(symbol)
 outreg2 using "$test/baseline.tex", replace $full_spc keep (pc_dummy ${covariates} ) addtext(Firm and Year FE, Y,Firm Controls, Y , Sector Specific Time Trend, Y, Province Specific Time Trend,Y)   

 
 reghdfe roe pc_dummy  i.ind_code_res#c.year  i.prov_code#c.year ${covariates} ,  absorb(year symbol)  cluster(symbol)
 outreg2 using "$test/baseline.tex", append $full_spc keep ( pc_dummy ${covariates}) addtext(Firm and Year FE, Y,Firm Controls, Y , Sector Specific Time Trend, Y, Province Specific Time Trend,Y)   

 
 reghdfe eps pc_dummy  i.ind_code_res#c.year  i.prov_code#c.year ${covariates} ,  absorb(year symbol)  cluster(symbol)
 outreg2 using "$test/baseline.tex", append $full_spc keep ( pc_dummy ${covariates} ) addtext(Firm and Year FE, Y,Firm Controls, Y , Sector Specific Time Trend, Y, Province Specific Time Trend,Y)   

 
**************************************
* Table A8 Continuous Measure of the Revolving Door
**************************************
* continous measure 
 lab var pc "Revolving Door (Continuous)"
reghdfe roa pc ,  absorb(year symbol)  cluster(symbol)
qui outreg2 using "$test/baseline.tex", replace $full_spc keep ( pc ) addtext(Firm and Year FE, Y , Firm Controls, N , Sector Specific Time Trend, N, Province Specific Time Trend, N) 

reghdfe roa pc  ${covariates}  ,  absorb(year symbol)  cluster(symbol)
qui outreg2 using "$test/baseline.tex", append $full_spc  keep (pc ) addtext(Firm and Year FE, Y,Firm Controls, Y , Sector Specific Time Trend, N, Province Specific Time Trend, N) 

reghdfe roa pc  i.ind_code_res#c.year ${covariates} ,  absorb(year symbol)  cluster(symbol)
qui outreg2 using "$test/baseline.tex", append $full_spc keep (pc ) addtext(Firm and Year FE, Y,Firm Controls, Y , Sector Specific Time Trend, Y,Province Specific Time Trend, N) 

reghdfe roa pc  i.prov_code#c.year ${covariates} ,  absorb(year symbol)  cluster(symbol)
 outreg2 using "$test/baseline.tex", append $full_spc keep (pc ) addtext(Firm and Year FE, Y,Firm Controls, Y, Sector Specific Time Trend, N,Province Specific Time Trend,Y)  

reghdfe roa pc  i.ind_code_res#c.year  i.prov_code#c.year ${covariates} ,  absorb(year symbol)  cluster(symbol)
outreg2 using "$test/baseline.tex", append $full_spc keep (pc ) addtext(Firm and Year FE, Y,Firm Controls, Y , Sector Specific Time Trend, Y, Province Specific Time Trend,Y)   


**************************************
* Table A9 Ratio Measure of the Revolving Door
**************************************
lab var pc_ratio "Revolving Door (Ratio)"

global full_spc    nocons  dec(3) addstat(Adjusted R-squared, e(r2_a))   lab 

reghdfe roa pc_ratio ,  absorb(year symbol)  cluster(symbol)
qui outreg2 using "$test/baseline.tex", replace $full_spc keep ( pc_ratio ) addtext(Firm and Year FE, Y , Firm Controls, N , Sector Specific Time Trend, N, Province Specific Time Trend, N) 

reghdfe roa pc_ratio  ${covariates}  ,  absorb(year symbol)  cluster(symbol)
qui outreg2 using "$test/baseline.tex", append $full_spc  keep (pc_ratio ) addtext(Firm and Year FE, Y,Firm Controls, Y , Sector Specific Time Trend, N, Province Specific Time Trend, N) 

reghdfe roa pc_ratio  i.ind_code_res#c.year ${covariates} ,  absorb(year symbol)  cluster(symbol)
qui outreg2 using "$test/baseline.tex", append $full_spc keep (pc_ratio ) addtext(Firm and Year FE, Y,Firm Controls, Y , Sector Specific Time Trend, Y,Province Specific Time Trend, N) 

reghdfe roa pc_ratio  i.prov_code#c.year ${covariates} ,  absorb(year symbol)  cluster(symbol)
 outreg2 using "$test/baseline.tex", append $full_spc keep (pc_ratio ) addtext(Firm and Year FE, Y,Firm Controls, Y, Sector Specific Time Trend, N,Province Specific Time Trend,Y)  

reghdfe roa pc_ratio  i.ind_code_res#c.year  i.prov_code#c.year ${covariates} ,  absorb(year symbol)  cluster(symbol)
outreg2 using "$test/baseline.tex", append $full_spc keep (pc_ratio ) addtext(Firm and Year FE, Y,Firm Controls, Y , Sector Specific Time Trend, Y, Province Specific Time Trend,Y)   



****************************************
* TABLE A10
*PLACEBO TEST II:  People Congress Member or CPPCC member AS FAKE TREATMENT
****************************************


reghdfe roa npc_dummy  i.ind_code_res#c.year  i.prov_code#c.year ${short_covariates} ,  absorb(year symbol)  cluster(symbol)

 outreg2 using "$test/baseline.tex", replace $full_spc keep ($alternativetreat) addtext(Firm and Year FE, Y,Firm Controls, Y , Sector Specific Time Trend, Y, Province Specific Time Trend,Y)   


 reghdfe roa cppcc_dummy  i.ind_code_res#c.year  i.prov_code#c.year ${short_covariates} ,  absorb(year symbol)  cluster(symbol)

 outreg2 using "$test/baseline.tex", append $full_spc keep ($alternativetreat) addtext(Firm and Year FE, Y,Firm Controls, Y , Sector Specific Time Trend, Y, Province Specific Time Trend,Y)   

 reghdfe roa  cpc_dummy i.ind_code_res#c.year  i.prov_code#c.year ${short_covariates} ,  absorb(year symbol)  cluster(symbol)

 outreg2 using "$test/baseline.tex", append $full_spc keep ($alternativetreat) addtext(Firm and Year FE, Y,Firm Controls, Y , Sector Specific Time Trend, Y, Province Specific Time Trend,Y)   

 

***********************
* Table 11  Non-SOE Sample
***********************

reghdfe roa pc_dummy if soe == 0 ,  absorb(year symbol)  cluster(symbol)
qui outreg2 using "$test/baseline.tex", replace $full_spc keep ( pc_dummy ) addtext(Firm and Year FE, Y , Firm Controls, N , Sector Specific Time Trend, N, Province Specific Time Trend, N) 

reghdfe roa pc_dummy  ${covariates}  if soe == 0,  absorb(year symbol)  cluster(symbol)
qui outreg2 using "$test/baseline.tex", append $full_spc  keep (pc_dummy ) addtext(Firm and Year FE, Y,Firm Controls, Y , Sector Specific Time Trend, N, Province Specific Time Trend, N) 

reghdfe roa pc_dummy  i.ind_code_res#c.year ${covariates} if soe == 0,  absorb(year symbol)  cluster(symbol)
qui outreg2 using "$test/baseline.tex", append $full_spc keep (pc_dummy) addtext(Firm and Year FE, Y,Firm Controls, Y , Sector Specific Time Trend, Y,Province Specific Time Trend, N) 

reghdfe roa pc_dummy  i.prov_code#c.year ${covariates} if soe == 0,  absorb(year symbol)  cluster(symbol)
 outreg2 using "$test/baseline.tex", append $full_spc keep (pc_dummy) addtext(Firm and Year FE, Y,Firm Controls, Y, Sector Specific Time Trend, N,Province Specific Time Trend,Y)  

reghdfe roa pc_dummy  i.ind_code_res#c.year  i.prov_code#c.year ${covariates} if soe == 0,  absorb(year symbol)  cluster(symbol)
outreg2 using "$test/baseline.tex", append $full_spc keep (pc_dummy) addtext(Firm and Year FE, Y,Firm Controls, Y , Sector Specific Time Trend, Y, Province Specific Time Trend,Y)   




 
*************************************
* Table A12 PSM
*************************************

set seed 0001 //set seed
gen tmp = runiform() // generate random number
sort tmp //sort by random number
psmatch2 pc_dummy $covariates, logit ate neighbor(1) common caliper(.05) ties
pstest  $covariates, both   //
gen common=_support
drop if common == 0  //drop obs does not have common support


reghdfe roa pc_dummy _pscore,  absorb(year symbol)  cluster(symbol)
qui outreg2 using "$test/baseline.tex", replace $full_spc keep (pc_dummy ${covariates}) addtext(Firm and Year FE, Y , Firm Controls, N , Sector Specific Time Trend, N, Province Specific Time Trend, N) 

reghdfe roa pc_dummy  _pscore ${covariates}  ,  absorb(year symbol)  cluster(symbol)
qui outreg2 using "$test/baseline.tex", append $full_spc  keep (pc_dummy ${covariates}) addtext(Firm and Year FE, Y,Firm Controls, Y , Sector Specific Time Trend, N, Province Specific Time Trend, N) 

reghdfe roa pc_dummy  _pscore i.ind_code_res#c.year ${covariates} ,  absorb(year symbol)  cluster(symbol)
qui outreg2 using "$test/baseline.tex", append $full_spc keep (pc_dummy ${covariates}) addtext(Firm and Year FE, Y,Firm Controls, Y , Sector Specific Time Trend, Y,Province Specific Time Trend, N) 

reghdfe roa pc_dummy  _pscore i.prov_code#c.year ${covariates} ,  absorb(year symbol)  cluster(symbol)
 outreg2 using "$test/baseline.tex", append $full_spc keep (pc_dummy ${covariates}) addtext(Firm and Year FE, Y,Firm Controls, Y, Sector Specific Time Trend, N,Province Specific Time Trend,Y)  

reghdfe roa pc_dummy  _pscore i.ind_code_res#c.year  i.prov_code#c.year ${covariates} ,  absorb(year symbol)  cluster(symbol)
 outreg2 using "$test/baseline.tex", append $full_spc keep (pc_dummy ${covariates}) addtext(Firm and Year FE, Y,Firm Controls, Y , Sector Specific Time Trend, Y, Province Specific Time Trend,Y)   


***************************************
* Table A13  preferential treatment
***************************************

use "/Users/zerenli1992/Dropbox/political_risk/data/pc_df_2022test.dta" ,clear


run "/Users/zerenli1992/Dropbox/political_risk/replication_files/data_pre_process"



global full_spc    nocons  dec(3) addstat(Adjusted R-squared, e(r2_a))addtext(Firm and Year FE, Y,Firm Controls, Y , Province Specific Time Trend, Y, Sector Specific Time Trend, Y)   lab /// noaster


reghdfe lsubsidy_total pc_dummy  i.ind_code_res#c.year i.prov_code#c.year   ${covariates} ,  absorb(year symbol)  cluster(symbol)
outreg2 using "$test/baseline.tex", replace $full_spc keep (pc_dummy ) 

reghdfe ltaxpay pc_dummy  i.ind_code_res#c.year i.prov_code#c.year  ${covariates} ,  absorb(year symbol)  cluster(symbol)
outreg2 using "$test/baseline.tex", append $full_spc keep (pc_dummy ) 


reghdfe invinest_l pc_dummy  i.ind_code_res#c.year i.prov_code#c.year  ${covariates} ,  absorb(year symbol)  cluster(symbol)
outreg2 using "$test/baseline.tex", append $full_spc keep (pc_dummy ) 
 

*****************************************
* Table A14 Marginal Effect Analysis 
*****************************************

global full_spc    nocons  dec(3) addstat(Adjusted R-squared, e(r2_a))  lab 

 
reghdfe roa  $purge_inter ,  absorb(year symbol)  cluster(symbol)
qui outreg2 using "$test/baseline.tex", replace $full_spc  keep ( $purge_inter ${covariates}) addtext(Firm and Year FE, Y,Firm Controls, Y , Sector Specific Time Trend, N, Province Specific Time Trend, N) 

reghdfe roa $purge_inter i.ind_code_res#c.year ${covariates} ,  absorb(year symbol)  cluster(symbol)
qui outreg2 using "$test/baseline.tex", append $full_spc keep ( $purge_inter ${covariates}) addtext(Firm and Year FE, Y,Firm Controls, Y , Sector Specific Time Trend, Y,Province Specific Time Trend, N) 

reghdfe roa $purge_inter i.ind_code_res#c.year i.prov_code#c.year ${covariates} ,  absorb(year symbol)  cluster(symbol)
 outreg2 using "$test/baseline.tex", append $full_spc keep ( $purge_inter ${covariates}) addtext(Firm and Year FE, Y,Firm Controls, Y, Sector Specific Time Trend, N,Province Specific Time Trend,Y)  

reghdfe roa  $purge_mkt_inter ,  absorb(year symbol)  cluster(symbol)
qui outreg2 using "$test/baseline.tex", append $full_spc  keep (  $purge_mkt_inter ${covariates}) addtext(Firm and Year FE, Y,Firm Controls, Y , Sector Specific Time Trend, N, Province Specific Time Trend, N) 

reghdfe roa $purge_mkt_inter i.ind_code_res#c.year ${covariates} ,  absorb(year symbol)  cluster(symbol)
qui outreg2 using "$test/baseline.tex", append $full_spc keep (  $purge_mkt_inter ${covariates}) addtext(Firm and Year FE, Y,Firm Controls, Y , Sector Specific Time Trend, Y,Province Specific Time Trend, N) 

reghdfe roa $purge_mkt_inter i.ind_code_res#c.year i.prov_code#c.year ${covariates} ,  absorb(year symbol)  cluster(symbol)
 outreg2 using "$test/baseline.tex", append $full_spc keep (  $purge_mkt_inter ${covariates}) addtext(Firm and Year FE, Y,Firm Controls, Y, Sector Specific Time Trend, N,Province Specific Time Trend,Y)  


  
*******************************
*Table A 15 Cross-Sector variation
*******************************

global full_spc    nocons  dec(3) addstat(Adjusted R-squared, e(r2_a)) lab /// noaster


* creat rent-seeking sector variable
g rentseeking = 0

replace  rentseeking = 1 if ind_code_res == 4 |ind_code_res == 10 | ///
ind_code_res == 11 | ind_code_res == 5 

g pc_rentseeking = rentseeking*pc_dummy
lab var rentseeking "Rent-seeking Sector"
lab var pc_rentseeking "Revolving Door*Rent-seeking Sector"
global rent_inter pc_rentseeking pc_dummy rentseeking

reghdfe roa $rent_inter ,  absorb(year symbol)  cluster(symbol)
qui outreg2 using "$test/baseline.tex", replace $full_spc keep ( $rent_inter ) ///
 addtext(Firm and Year FE, Y , Firm Controls, N)

reghdfe roa $rent_inter ${covariates}  ,  absorb(year symbol)  cluster(symbol)
 outreg2 using "$test/baseline.tex", append $full_spc keep ($rent_inter) ///
 addtext(Firm and Year FE, Y , Firm Controls, Y) 
 
 
 
